<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <style>
      .demo {
        width: 300px;
        margin: 200px auto;
      }
      .demo input {
        width: 100%;
        cursor: pointer;
      }
    </style>
  </head>
  <body>
    <div class="demo">
      <p>分数：<span class="num">0</span></p>
      <input type="range" value="0" />
    </div>

    <script>
      const input = document.querySelector('input')
      const num = document.querySelector('.num')
      input.addEventListener('mousemove', function () {
        num.innerHTML = input.value
      })
    </script>
  </body>
</html>
